Integrand size = 16, antiderivative size = 96 \[ \int (c+d x)^2 \tan ^2(a+b x) \, dx=-\frac {i (c+d x)^2}{b}-\frac {(c+d x)^3}{3 d}+\frac {2 d (c+d x) \log \left (1+e^{2 i (a+b x)}\right )}{b^2}-\frac {i d^2 \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^3}+\frac {(c+d x)^2 \tan (a+b x)}{b} \]
[Out]
Time = 0.17 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {3801, 3800, 2221, 2317, 2438, 32} \[ \int (c+d x)^2 \tan ^2(a+b x) \, dx=-\frac {i d^2 \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^3}+\frac {2 d (c+d x) \log \left (1+e^{2 i (a+b x)}\right )}{b^2}+\frac {(c+d x)^2 \tan (a+b x)}{b}-\frac {i (c+d x)^2}{b}-\frac {(c+d x)^3}{3 d} \]
[In]
[Out]
Rule 32
Rule 2221
Rule 2317
Rule 2438
Rule 3800
Rule 3801
Rubi steps \begin{align*} \text {integral}& = \frac {(c+d x)^2 \tan (a+b x)}{b}-\frac {(2 d) \int (c+d x) \tan (a+b x) \, dx}{b}-\int (c+d x)^2 \, dx \\ & = -\frac {i (c+d x)^2}{b}-\frac {(c+d x)^3}{3 d}+\frac {(c+d x)^2 \tan (a+b x)}{b}+\frac {(4 i d) \int \frac {e^{2 i (a+b x)} (c+d x)}{1+e^{2 i (a+b x)}} \, dx}{b} \\ & = -\frac {i (c+d x)^2}{b}-\frac {(c+d x)^3}{3 d}+\frac {2 d (c+d x) \log \left (1+e^{2 i (a+b x)}\right )}{b^2}+\frac {(c+d x)^2 \tan (a+b x)}{b}-\frac {\left (2 d^2\right ) \int \log \left (1+e^{2 i (a+b x)}\right ) \, dx}{b^2} \\ & = -\frac {i (c+d x)^2}{b}-\frac {(c+d x)^3}{3 d}+\frac {2 d (c+d x) \log \left (1+e^{2 i (a+b x)}\right )}{b^2}+\frac {(c+d x)^2 \tan (a+b x)}{b}+\frac {\left (i d^2\right ) \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{2 i (a+b x)}\right )}{b^3} \\ & = -\frac {i (c+d x)^2}{b}-\frac {(c+d x)^3}{3 d}+\frac {2 d (c+d x) \log \left (1+e^{2 i (a+b x)}\right )}{b^2}-\frac {i d^2 \operatorname {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^3}+\frac {(c+d x)^2 \tan (a+b x)}{b} \\ \end{align*}
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(276\) vs. \(2(96)=192\).
Time = 6.40 (sec) , antiderivative size = 276, normalized size of antiderivative = 2.88 \[ \int (c+d x)^2 \tan ^2(a+b x) \, dx=-\frac {1}{3} x \left (3 c^2+3 c d x+d^2 x^2\right )+\frac {2 c d \sec (a) (\cos (a) \log (\cos (a) \cos (b x)-\sin (a) \sin (b x))+b x \sin (a))}{b^2 \left (\cos ^2(a)+\sin ^2(a)\right )}+\frac {d^2 \csc (a) \left (b^2 e^{-i \arctan (\cot (a))} x^2-\frac {\cot (a) \left (i b x (-\pi -2 \arctan (\cot (a)))-\pi \log \left (1+e^{-2 i b x}\right )-2 (b x-\arctan (\cot (a))) \log \left (1-e^{2 i (b x-\arctan (\cot (a)))}\right )+\pi \log (\cos (b x))-2 \arctan (\cot (a)) \log (\sin (b x-\arctan (\cot (a))))+i \operatorname {PolyLog}\left (2,e^{2 i (b x-\arctan (\cot (a)))}\right )\right )}{\sqrt {1+\cot ^2(a)}}\right ) \sec (a)}{b^3 \sqrt {\csc ^2(a) \left (\cos ^2(a)+\sin ^2(a)\right )}}+\frac {\sec (a) \sec (a+b x) \left (c^2 \sin (b x)+2 c d x \sin (b x)+d^2 x^2 \sin (b x)\right )}{b} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 198 vs. \(2 (88 ) = 176\).
Time = 1.58 (sec) , antiderivative size = 199, normalized size of antiderivative = 2.07
method | result | size |
risch | \(-\frac {d^{2} x^{3}}{3}-d c \,x^{2}-c^{2} x -\frac {c^{3}}{3 d}+\frac {2 i \left (x^{2} d^{2}+2 c d x +c^{2}\right )}{b \left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right )}+\frac {2 d c \ln \left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right )}{b^{2}}-\frac {4 d c \ln \left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}-\frac {2 i d^{2} x^{2}}{b}-\frac {4 i d^{2} x a}{b^{2}}-\frac {2 i d^{2} a^{2}}{b^{3}}+\frac {2 d^{2} \ln \left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right ) x}{b^{2}}-\frac {i d^{2} \operatorname {polylog}\left (2, -{\mathrm e}^{2 i \left (x b +a \right )}\right )}{b^{3}}+\frac {4 d^{2} a \ln \left ({\mathrm e}^{i \left (x b +a \right )}\right )}{b^{3}}\) | \(199\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 210 vs. \(2 (85) = 170\).
Time = 0.24 (sec) , antiderivative size = 210, normalized size of antiderivative = 2.19 \[ \int (c+d x)^2 \tan ^2(a+b x) \, dx=-\frac {2 \, b^{3} d^{2} x^{3} + 6 \, b^{3} c d x^{2} + 6 \, b^{3} c^{2} x - 3 i \, d^{2} {\rm Li}_2\left (\frac {2 \, {\left (i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) + 3 i \, d^{2} {\rm Li}_2\left (\frac {2 \, {\left (-i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1} + 1\right ) - 6 \, {\left (b d^{2} x + b c d\right )} \log \left (-\frac {2 \, {\left (i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1}\right ) - 6 \, {\left (b d^{2} x + b c d\right )} \log \left (-\frac {2 \, {\left (-i \, \tan \left (b x + a\right ) - 1\right )}}{\tan \left (b x + a\right )^{2} + 1}\right ) - 6 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \tan \left (b x + a\right )}{6 \, b^{3}} \]
[In]
[Out]
\[ \int (c+d x)^2 \tan ^2(a+b x) \, dx=\int \left (c + d x\right )^{2} \tan ^{2}{\left (a + b x \right )}\, dx \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 418 vs. \(2 (85) = 170\).
Time = 0.39 (sec) , antiderivative size = 418, normalized size of antiderivative = 4.35 \[ \int (c+d x)^2 \tan ^2(a+b x) \, dx=\frac {i \, b^{3} d^{2} x^{3} + 3 i \, b^{3} c d x^{2} + 3 i \, b^{3} c^{2} x + 6 \, b^{2} c^{2} + 6 \, {\left (b d^{2} x + b c d + {\left (b d^{2} x + b c d\right )} \cos \left (2 \, b x + 2 \, a\right ) - {\left (-i \, b d^{2} x - i \, b c d\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} \arctan \left (\sin \left (2 \, b x + 2 \, a\right ), \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) + {\left (i \, b^{3} d^{2} x^{3} - 3 \, {\left (-i \, b^{3} c d + 2 \, b^{2} d^{2}\right )} x^{2} - 3 \, {\left (-i \, b^{3} c^{2} + 4 \, b^{2} c d\right )} x\right )} \cos \left (2 \, b x + 2 \, a\right ) - 3 \, {\left (d^{2} \cos \left (2 \, b x + 2 \, a\right ) + i \, d^{2} \sin \left (2 \, b x + 2 \, a\right ) + d^{2}\right )} {\rm Li}_2\left (-e^{\left (2 i \, b x + 2 i \, a\right )}\right ) - 3 \, {\left (i \, b d^{2} x + i \, b c d + {\left (i \, b d^{2} x + i \, b c d\right )} \cos \left (2 \, b x + 2 \, a\right ) - {\left (b d^{2} x + b c d\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} \log \left (\cos \left (2 \, b x + 2 \, a\right )^{2} + \sin \left (2 \, b x + 2 \, a\right )^{2} + 2 \, \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) - {\left (b^{3} d^{2} x^{3} + 3 \, {\left (b^{3} c d + 2 i \, b^{2} d^{2}\right )} x^{2} + 3 \, {\left (b^{3} c^{2} + 4 i \, b^{2} c d\right )} x\right )} \sin \left (2 \, b x + 2 \, a\right )}{-3 i \, b^{3} \cos \left (2 \, b x + 2 \, a\right ) + 3 \, b^{3} \sin \left (2 \, b x + 2 \, a\right ) - 3 i \, b^{3}} \]
[In]
[Out]
\[ \int (c+d x)^2 \tan ^2(a+b x) \, dx=\int { {\left (d x + c\right )}^{2} \tan \left (b x + a\right )^{2} \,d x } \]
[In]
[Out]
Timed out. \[ \int (c+d x)^2 \tan ^2(a+b x) \, dx=\int {\mathrm {tan}\left (a+b\,x\right )}^2\,{\left (c+d\,x\right )}^2 \,d x \]
[In]
[Out]